package cn.net.ecode.elec.plan.service;

import cn.net.ecode.common.persistence.Page;
import cn.net.ecode.common.service.CrudService;
import cn.net.ecode.elec.plan.dao.ElecPlanDao;
import cn.net.ecode.elec.plan.entity.ElecPlan;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 报电量Service
 *
 * @author AlanShelby
 * @version 2019-08-28
 */
@Service
@Transactional(readOnly = true)
public class ElecPlanService extends CrudService<ElecPlanDao, ElecPlan> {

    /**
     * 获取单条数据
     *
     * @param elecPlan
     * @return
     */
    public ElecPlan get(ElecPlan elecPlan) {
        return super.get(elecPlan);
    }

    /**
     * 查询列表数据
     *
     * @param elecPlan
     * @return
     */
    public List<ElecPlan> findList(ElecPlan elecPlan) {
        return super.findList(elecPlan);
    }

    /**
     * 查询分页数据
     *
     * @param page     分页对象
     * @param elecPlan
     * @return
     */
    public Page<ElecPlan> findPage(Page<ElecPlan> page, ElecPlan elecPlan) {
        return super.findPage(page, elecPlan);
    }

    /**
     * 保存数据（插入或更新）
     *
     * @param elecPlan
     */
    @Transactional(readOnly = false)
    public void save(ElecPlan elecPlan) {
        super.save(elecPlan);
    }

    /**
     * 删除数据
     *
     * @param elecPlan
     */
    @Transactional(readOnly = false)
    public void delete(ElecPlan elecPlan) {
        super.delete(elecPlan);
    }
}